#include <iostream>
#include <vec2d.h>
#include <list.h>

using namespace ePhys;

void test(bool pass) {
	if(pass)
		std::cout << "PASS ";
	else
		std::cout << "FAIL ";
}

void listTest(void) {
	std::cout << "Testing list: ";

	int a = 1; int b = 5; int c = 2; int d = 3;
	ePhys::list<int*> myList;
	myList.push_back(&a); //1 - 1
	myList.push_back(&b); //2 - 5
	myList.push_back(&c); //3 - 2
	myList.push_front(&d); //0 - 3

	test(*myList[2] == 5);
	
	myList.remove(&d);
	test(*myList[2] == 2 && myList.getSize() == 3);

	myList.insert(&d, 1);
	test(myList.getIndex(&d) == 1);

	myList.removeAt(1);
	test(myList.getIndex(&d)==-1&&myList.getSize()==3);

	std::cout << std::endl;
}

int main(char **argv, int argc) {
	
	std::cout << "Testing Easy Physics library..." << std::endl;
	std::cout << "-- Shared tests" << std::endl;
	
	listTest();

	std::cout << "-- 2D Tests" << std::endl;

	return 0;
}
